package com.barks.learning.base.intercepter;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.MethodParameter;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.method.support.HandlerMethodReturnValueHandler;
import org.springframework.web.method.support.ModelAndViewContainer;


/**
 * @author chenw-i
 * @version 1.0.0
 * @ClassName HandlerResult.java
 * @Description TODO
 * @createTime 2020年07月11日 19:46:00
 */
public class HandlerResult implements HandlerMethodReturnValueHandler {
    private Logger logger = LoggerFactory.getLogger(HandlerResult.class);
    @Override
    public boolean supportsReturnType(MethodParameter returnType) {
        return true;
    }

    @Override
    public void handleReturnValue(Object returnValue, MethodParameter returnType, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception {
        logger.info("handleReturnValue returnValue:{} ,returnType:{},mavContainer:{},webRequest:{}", returnValue,returnType,mavContainer,webRequest);
    }
}
